package com.meiyue.bean.entity;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * MeiyueJavaProject
 * com.meiyue.bean.entity
 * Created by Chris Chen
 * 2017/9/14
 * Explain:
 */
@Entity
@Table(name = "test_orders", schema = "test_yuedao", catalog = "")
public class TestOrdersEntity {
    private int id;
    private String guestName;
    private String guestCell;
    private Timestamp orderPlaceDatetime;
    private Timestamp orderScheduledStartDatetime;
    private Timestamp orderActualStartDatetime;
    private Timestamp orderCompleteDatetime;
    private int servicePlaceId;
    private int orderJourneyId;
    private int orderTypeId;
    private int representativeId;
    private int vehicleId;
    private int driverId;
    private int orderStatusId;
    private String description;

    @Id
    @Column(name = "id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "guest_name", nullable = true, length = 20)
    public String getGuestName() {
        return guestName;
    }

    public void setGuestName(String guestName) {
        this.guestName = guestName;
    }

    @Basic
    @Column(name = "guest_cell", nullable = true, length = 20)
    public String getGuestCell() {
        return guestCell;
    }

    public void setGuestCell(String guestCell) {
        this.guestCell = guestCell;
    }

    @Basic
    @Column(name = "order_place_datetime", nullable = true)
    public Timestamp getOrderPlaceDatetime() {
        return orderPlaceDatetime;
    }

    public void setOrderPlaceDatetime(Timestamp orderPlaceDatetime) {
        this.orderPlaceDatetime = orderPlaceDatetime;
    }

    @Basic
    @Column(name = "order_scheduled_start_datetime", nullable = true)
    public Timestamp getOrderScheduledStartDatetime() {
        return orderScheduledStartDatetime;
    }

    public void setOrderScheduledStartDatetime(Timestamp orderScheduledStartDatetime) {
        this.orderScheduledStartDatetime = orderScheduledStartDatetime;
    }

    @Basic
    @Column(name = "order_actual_start_datetime", nullable = true)
    public Timestamp getOrderActualStartDatetime() {
        return orderActualStartDatetime;
    }

    public void setOrderActualStartDatetime(Timestamp orderActualStartDatetime) {
        this.orderActualStartDatetime = orderActualStartDatetime;
    }

    @Basic
    @Column(name = "order_complete_datetime", nullable = true)
    public Timestamp getOrderCompleteDatetime() {
        return orderCompleteDatetime;
    }

    public void setOrderCompleteDatetime(Timestamp orderCompleteDatetime) {
        this.orderCompleteDatetime = orderCompleteDatetime;
    }

    @Basic
    @Column(name = "service_place_id", nullable = false)
    public int getServicePlaceId() {
        return servicePlaceId;
    }

    public void setServicePlaceId(int servicePlaceId) {
        this.servicePlaceId = servicePlaceId;
    }

    @Basic
    @Column(name = "order_journey_id", nullable = false)
    public int getOrderJourneyId() {
        return orderJourneyId;
    }

    public void setOrderJourneyId(int orderJourneyId) {
        this.orderJourneyId = orderJourneyId;
    }

    @Basic
    @Column(name = "order_type_id", nullable = false)
    public int getOrderTypeId() {
        return orderTypeId;
    }

    public void setOrderTypeId(int orderTypeId) {
        this.orderTypeId = orderTypeId;
    }

    @Basic
    @Column(name = "representative_id", nullable = false)
    public int getRepresentativeId() {
        return representativeId;
    }

    public void setRepresentativeId(int representativeId) {
        this.representativeId = representativeId;
    }

    @Basic
    @Column(name = "vehicle_id", nullable = false)
    public int getVehicleId() {
        return vehicleId;
    }

    public void setVehicleId(int vehicleId) {
        this.vehicleId = vehicleId;
    }

    @Basic
    @Column(name = "driver_id", nullable = false)
    public int getDriverId() {
        return driverId;
    }

    public void setDriverId(int driverId) {
        this.driverId = driverId;
    }

    @Basic
    @Column(name = "order_status_id", nullable = false)
    public int getOrderStatusId() {
        return orderStatusId;
    }

    public void setOrderStatusId(int orderStatusId) {
        this.orderStatusId = orderStatusId;
    }

    @Basic
    @Column(name = "description", nullable = false, length = 5000)
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TestOrdersEntity that = (TestOrdersEntity) o;

        if (id != that.id) return false;
        if (servicePlaceId != that.servicePlaceId) return false;
        if (orderJourneyId != that.orderJourneyId) return false;
        if (orderTypeId != that.orderTypeId) return false;
        if (representativeId != that.representativeId) return false;
        if (vehicleId != that.vehicleId) return false;
        if (driverId != that.driverId) return false;
        if (orderStatusId != that.orderStatusId) return false;
        if (guestName != null ? !guestName.equals(that.guestName) : that.guestName != null) return false;
        if (guestCell != null ? !guestCell.equals(that.guestCell) : that.guestCell != null) return false;
        if (orderPlaceDatetime != null ? !orderPlaceDatetime.equals(that.orderPlaceDatetime) : that.orderPlaceDatetime != null)
            return false;
        if (orderScheduledStartDatetime != null ? !orderScheduledStartDatetime.equals(that.orderScheduledStartDatetime) : that.orderScheduledStartDatetime != null)
            return false;
        if (orderActualStartDatetime != null ? !orderActualStartDatetime.equals(that.orderActualStartDatetime) : that.orderActualStartDatetime != null)
            return false;
        if (orderCompleteDatetime != null ? !orderCompleteDatetime.equals(that.orderCompleteDatetime) : that.orderCompleteDatetime != null)
            return false;
        if (description != null ? !description.equals(that.description) : that.description != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (guestName != null ? guestName.hashCode() : 0);
        result = 31 * result + (guestCell != null ? guestCell.hashCode() : 0);
        result = 31 * result + (orderPlaceDatetime != null ? orderPlaceDatetime.hashCode() : 0);
        result = 31 * result + (orderScheduledStartDatetime != null ? orderScheduledStartDatetime.hashCode() : 0);
        result = 31 * result + (orderActualStartDatetime != null ? orderActualStartDatetime.hashCode() : 0);
        result = 31 * result + (orderCompleteDatetime != null ? orderCompleteDatetime.hashCode() : 0);
        result = 31 * result + servicePlaceId;
        result = 31 * result + orderJourneyId;
        result = 31 * result + orderTypeId;
        result = 31 * result + representativeId;
        result = 31 * result + vehicleId;
        result = 31 * result + driverId;
        result = 31 * result + orderStatusId;
        result = 31 * result + (description != null ? description.hashCode() : 0);
        return result;
    }
}
